package player;

import ki.NimKI;
import interfaces.IPlayer;

public class NimKIPlayer implements IPlayer {
	String name;
	NimKI ki;
	
	public NimKIPlayer(String name, NimKI ki) {
		this.name = name;
		this.ki = ki;
		
	}	
	
	@Override
	public String getName() {
		return this.name;
	}

	@Override
	public int turn() {
		System.out.println("KI: next turn will be calculated");
		
		//lets sleep a little bit to act like a human :)
		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		int sticksToTake = this.ki.getNextMove(); 
		System.out.println("KI: i will take: " + sticksToTake);
		System.out.println();
		
		return sticksToTake;
	}

	@Override
	public void printMessage(String message) {
		System.out.println("Message to NimKIPlayer: " + message);
		
	}

}
